<?php


class LivePackageDetail extends CActiveRecord
{
	
	public static function model($Vgmajjibziuy=__CLASS__)
	{
		return parent::model($Vgmajjibziuy);
	}

	
	public function tableName()
	{
		return 'live_package_detail';
	}

	
	public function rules()
	{
		
		
		return array(
			array('live_package_id', 'required'),
			array('live_package_id, live_channel_id, live_category_id, create_user_id, status', 'numerical', 'integerOnly'=>true),
			array('create_date', 'safe'),
			
			
			array('id, live_package_id, live_channel_id, live_category_id, create_date, create_user_id, status', 'safe', 'on'=>'search'),
		);
	}

	
	public function relations()
	{
		
		
		return array(
			'livePackage' => array(self::BELONGS_TO, 'LivePackage', 'live_package_id'),
			'liveChannel' => array(self::BELONGS_TO, 'LiveChannel', 'live_channel_id'),
			'liveCategory' => array(self::BELONGS_TO, 'LiveCategory', 'live_category_id'),
			'createUser' => array(self::BELONGS_TO, 'BackendUser', 'create_user_id'),
			
		);
	}

	
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'live_package_id' => 'Live Package',
			'live_channel_id' => 'Live Channel',
			'live_category_id' => 'Live Category',
			'create_date' => 'Create Date',
			'create_user_id' => 'Create User',
			'status' => 'Status',
			
		);
	}

	
	public function search()
	{
		
		

		$V0v5vsnfxezw=new CDbCriteria;

		$V0v5vsnfxezw->compare('id',$this->id);
		$V0v5vsnfxezw->compare('live_package_id',$this->live_package_id);
		$V0v5vsnfxezw->compare('live_channel_id',$this->live_channel_id);
		$V0v5vsnfxezw->compare('live_category_id',$this->live_category_id);
		$V0v5vsnfxezw->compare('create_date',$this->create_date,true);
		$V0v5vsnfxezw->compare('create_user_id',$this->create_user_id);
		$V0v5vsnfxezw->compare('status',$this->status);
		

		return new CActiveDataProvider($this, array(
			'criteria'=>$V0v5vsnfxezw,
		));
	}
}